<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        h1{
            width: 200px;
            height: 200px;
            background-color: blue
        }
    </style>
    <script src="./index.js"></script>
    <script>
        window.onload = function (){ 
            $('h1').onclick = function(evt){
                // console.log(evt)
                console.log('offsetX',evt.offsetX,'offsetY:',evt.offsetY)
                console.log('clientX',evt.clientX,'clientY:',evt.clientY)
                console.log('screenX',evt.screenX,'screenY:',evt.screenY)

            };
            onkeydown = function (evt){
                console.log("keydown:",evt.which);
            };
            onkeypress = function (evt){
                console.log('keypress:',evt.which,evt.key);
            }
            };

    </script>
</head>
<body>
    <h1>一级标签</h1>
</body>
</html>